package ro.dandanciu.webgallery.gallery.dto;

import ro.dandanciu.webgallery.domainmodel.Image;

public class GallerySyncDTO {
	
	/**
	 * The possible values for status for synchronization.
	 */
	public static enum Status {		
		SYNCRONIZED,
		MISSING_ON_REMOTE,
		MISSING_ON_LOCAL		
	}
	
	private String name;
	
	/**
	 * The local image, the one we have in the application.
	 */
	private Image local;
	
	/**
	 * The remote image, the one is for example on file system.
	 */
	private Image remote;
	
	/**
	 * The status of this element.
	 */
	private Status status;

	/**
	 * @return the local
	 */
	public Image getLocal() {
		return local;
	}

	/**
	 * @param local the local to set
	 */
	public void setLocal(Image local) {
		this.local = local;
	}

	/**
	 * @return the remote
	 */
	public Image getRemote() {
		return remote;
	}

	/**
	 * @param remote the remote to set
	 */
	public void setRemote(Image remote) {
		this.remote = remote;
	}

	/**
	 * @return the status
	 */
	public Status getStatus() {
		return status;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(Status status) {
		this.status = status;
	}

	public GallerySyncDTO(String name) {
		super();
		this.name = name;
	}

	public String getName() {
		return name;
	}

	
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final GallerySyncDTO other = (GallerySyncDTO) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
}
